<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.13"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>Alexa Auto SDK: com.amazon.aace.audio.AudioOutput Class Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectlogo"><img alt="Logo" src="aace-logo.png"/></td>
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">Alexa Auto SDK
   &#160;<span id="projectnumber">2.2.0</span>
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.13 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
$(function() {
  initMenu('',true,false,'search.php','Search');
  $(document).ready(function() { init_search(); });
});
</script>
<div id="main-nav"></div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div id="nav-path" class="navpath">
  <ul>
<li class="navelem"><b>com</b></li><li class="navelem"><b>amazon</b></li><li class="navelem"><b>aace</b></li><li class="navelem"><b>audio</b></li><li class="navelem"><a class="el" href="classcom_1_1amazon_1_1aace_1_1audio_1_1_audio_output.html">AudioOutput</a></li>  </ul>
</div>
</div><!-- top -->
<div class="header">
  <div class="summary">
<a href="#nested-classes">Classes</a> &#124;
<a href="#pub-methods">Public Member Functions</a> &#124;
<a href="#pub-static-attribs">Static Public Attributes</a> &#124;
<a href="#pro-methods">Protected Member Functions</a> &#124;
<a href="classcom_1_1amazon_1_1aace_1_1audio_1_1_audio_output-members.html">List of all members</a>  </div>
  <div class="headertitle">
<div class="title">com.amazon.aace.audio.AudioOutput Class Reference<span class="mlabels"><span class="mlabel">abstract</span></span></div>  </div>
</div><!--header-->
<div class="contents">
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="nested-classes"></a>
Classes</h2></td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">enum &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="enumcom_1_1amazon_1_1aace_1_1audio_1_1_audio_output_1_1_media_error.html">MediaError</a></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">enum &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="enumcom_1_1amazon_1_1aace_1_1audio_1_1_audio_output_1_1_media_state.html">MediaState</a></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">enum &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="enumcom_1_1amazon_1_1aace_1_1audio_1_1_audio_output_1_1_muted_state.html">MutedState</a></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-methods"></a>
Public Member Functions</h2></td></tr>
<tr class="memitem:aff7e7f7323143c4843d48a0650ce91b4"><td class="memItemLeft" align="right" valign="top">boolean&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classcom_1_1amazon_1_1aace_1_1audio_1_1_audio_output.html#aff7e7f7323143c4843d48a0650ce91b4">prepare</a> (AudioStream stream, boolean repeating)</td></tr>
<tr class="separator:aff7e7f7323143c4843d48a0650ce91b4"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ae3726cd2b38409262fadedc25a9a68e7"><td class="memItemLeft" align="right" valign="top">boolean&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classcom_1_1amazon_1_1aace_1_1audio_1_1_audio_output.html#ae3726cd2b38409262fadedc25a9a68e7">prepare</a> (String url, boolean repeating)</td></tr>
<tr class="separator:ae3726cd2b38409262fadedc25a9a68e7"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ab832b921a38be3faa8729a6a7f45b033"><td class="memItemLeft" align="right" valign="top">boolean&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classcom_1_1amazon_1_1aace_1_1audio_1_1_audio_output.html#ab832b921a38be3faa8729a6a7f45b033">play</a> ()</td></tr>
<tr class="separator:ab832b921a38be3faa8729a6a7f45b033"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a93328cd0e726f19b596a18343418082c"><td class="memItemLeft" align="right" valign="top">boolean&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classcom_1_1amazon_1_1aace_1_1audio_1_1_audio_output.html#a93328cd0e726f19b596a18343418082c">stop</a> ()</td></tr>
<tr class="separator:a93328cd0e726f19b596a18343418082c"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a1dfc109dfffdb40f04cdb40cb959772e"><td class="memItemLeft" align="right" valign="top">boolean&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classcom_1_1amazon_1_1aace_1_1audio_1_1_audio_output.html#a1dfc109dfffdb40f04cdb40cb959772e">pause</a> ()</td></tr>
<tr class="separator:a1dfc109dfffdb40f04cdb40cb959772e"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a860c1575b54e245352fa2c8d05baf1e9"><td class="memItemLeft" align="right" valign="top">boolean&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classcom_1_1amazon_1_1aace_1_1audio_1_1_audio_output.html#a860c1575b54e245352fa2c8d05baf1e9">resume</a> ()</td></tr>
<tr class="separator:a860c1575b54e245352fa2c8d05baf1e9"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:affc2aadf7fe81a6a9463152ae51420f8"><td class="memItemLeft" align="right" valign="top">long&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classcom_1_1amazon_1_1aace_1_1audio_1_1_audio_output.html#affc2aadf7fe81a6a9463152ae51420f8">getPosition</a> ()</td></tr>
<tr class="separator:affc2aadf7fe81a6a9463152ae51420f8"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a228c6e8079d5782e1e7d9b21a925638d"><td class="memItemLeft" align="right" valign="top">boolean&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classcom_1_1amazon_1_1aace_1_1audio_1_1_audio_output.html#a228c6e8079d5782e1e7d9b21a925638d">setPosition</a> (long position)</td></tr>
<tr class="separator:a228c6e8079d5782e1e7d9b21a925638d"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a1d9d3fc28f5922dd608e5f4a1f774c4b"><td class="memItemLeft" align="right" valign="top">long&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classcom_1_1amazon_1_1aace_1_1audio_1_1_audio_output.html#a1d9d3fc28f5922dd608e5f4a1f774c4b">getDuration</a> ()</td></tr>
<tr class="separator:a1d9d3fc28f5922dd608e5f4a1f774c4b"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a2c5ab7cf1d8a4183a7b58716dccf916b"><td class="memItemLeft" align="right" valign="top">long&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classcom_1_1amazon_1_1aace_1_1audio_1_1_audio_output.html#a2c5ab7cf1d8a4183a7b58716dccf916b">getNumBytesBuffered</a> ()</td></tr>
<tr class="separator:a2c5ab7cf1d8a4183a7b58716dccf916b"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a95ca357a61bcf56227684c0a354e44f6"><td class="memItemLeft" align="right" valign="top">boolean&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classcom_1_1amazon_1_1aace_1_1audio_1_1_audio_output.html#a95ca357a61bcf56227684c0a354e44f6">volumeChanged</a> (float volume)</td></tr>
<tr class="separator:a95ca357a61bcf56227684c0a354e44f6"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:af9dbd926cff6739c7e9f26029f5f7a29"><td class="memItemLeft" align="right" valign="top">boolean&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classcom_1_1amazon_1_1aace_1_1audio_1_1_audio_output.html#af9dbd926cff6739c7e9f26029f5f7a29">mutedStateChanged</a> (<a class="el" href="enumcom_1_1amazon_1_1aace_1_1audio_1_1_audio_output_1_1_muted_state.html">MutedState</a> state)</td></tr>
<tr class="separator:af9dbd926cff6739c7e9f26029f5f7a29"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-static-attribs"></a>
Static Public Attributes</h2></td></tr>
<tr class="memitem:a60658d83dc03b3999057ace2b2cabefd"><td class="memItemLeft" align="right" valign="top">static final long&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classcom_1_1amazon_1_1aace_1_1audio_1_1_audio_output.html#a60658d83dc03b3999057ace2b2cabefd">TIME_UNKNOWN</a> = -1</td></tr>
<tr class="separator:a60658d83dc03b3999057ace2b2cabefd"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pro-methods"></a>
Protected Member Functions</h2></td></tr>
<tr class="memitem:affc23414f8a4c0dc7aa518e398123d3c"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classcom_1_1amazon_1_1aace_1_1audio_1_1_audio_output.html#affc23414f8a4c0dc7aa518e398123d3c">mediaError</a> (<a class="el" href="enumcom_1_1amazon_1_1aace_1_1audio_1_1_audio_output_1_1_media_error.html">MediaError</a> type, String error)</td></tr>
<tr class="separator:affc23414f8a4c0dc7aa518e398123d3c"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a9e50601e05eb9d32e1f56d75e7849fc3"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classcom_1_1amazon_1_1aace_1_1audio_1_1_audio_output.html#a9e50601e05eb9d32e1f56d75e7849fc3">mediaStateChanged</a> (<a class="el" href="enumcom_1_1amazon_1_1aace_1_1audio_1_1_audio_output_1_1_media_state.html">MediaState</a> state)</td></tr>
<tr class="separator:a9e50601e05eb9d32e1f56d75e7849fc3"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><p><a class="el" href="classcom_1_1amazon_1_1aace_1_1audio_1_1_audio_output.html">AudioOutput</a> should be extended to play audio data provided by the Engine.</p>
<p>After returning <code>true</code> from a playback-controlling method invocation from the Engine (i.e. <code><a class="el" href="classcom_1_1amazon_1_1aace_1_1audio_1_1_audio_output.html#ab832b921a38be3faa8729a6a7f45b033">play()</a></code>, <code><a class="el" href="classcom_1_1amazon_1_1aace_1_1audio_1_1_audio_output.html#a1dfc109dfffdb40f04cdb40cb959772e">pause()</a></code>, <code><a class="el" href="classcom_1_1amazon_1_1aace_1_1audio_1_1_audio_output.html#a93328cd0e726f19b596a18343418082c">stop()</a></code>, <code><a class="el" href="classcom_1_1amazon_1_1aace_1_1audio_1_1_audio_output.html#a860c1575b54e245352fa2c8d05baf1e9">resume()</a></code>), it is required that platform implementation notify the Engine of a playback state change by calling one of <code><a class="el" href="classcom_1_1amazon_1_1aace_1_1audio_1_1_audio_output.html#a9e50601e05eb9d32e1f56d75e7849fc3">mediaStateChanged()</a></code> with the new <code><a class="el" href="enumcom_1_1amazon_1_1aace_1_1audio_1_1_audio_output_1_1_media_state.html">MediaState</a></code> or <code><a class="el" href="classcom_1_1amazon_1_1aace_1_1audio_1_1_audio_output.html#affc23414f8a4c0dc7aa518e398123d3c">mediaError()</a></code> with the <code><a class="el" href="enumcom_1_1amazon_1_1aace_1_1audio_1_1_audio_output_1_1_media_error.html">MediaError</a></code>. The Engine expects no call to <code><a class="el" href="classcom_1_1amazon_1_1aace_1_1audio_1_1_audio_output.html#a9e50601e05eb9d32e1f56d75e7849fc3">mediaStateChanged()</a></code> in response to an invocation for which the platform returned <code>false</code>.</p>
<p>The platform implementation may call <code><a class="el" href="classcom_1_1amazon_1_1aace_1_1audio_1_1_audio_output.html#affc23414f8a4c0dc7aa518e398123d3c">mediaError()</a></code> or <code><a class="el" href="classcom_1_1amazon_1_1aace_1_1audio_1_1_audio_output.html#a9e50601e05eb9d32e1f56d75e7849fc3">mediaStateChanged()</a></code> with <code><a class="el" href="enumcom_1_1amazon_1_1aace_1_1audio_1_1_audio_output_1_1_media_state.html#a9f93dc6ebc20250f7e88ba87c8d9d649">MediaState.BUFFERING</a></code> at any time during a playback operation to notify the Engine of an error or buffer underrun, respectvely. When the media player resumes playback after a buffer underrun, the platform implementation should call <code><a class="el" href="classcom_1_1amazon_1_1aace_1_1audio_1_1_audio_output.html#a9e50601e05eb9d32e1f56d75e7849fc3">mediaStateChanged()</a></code> with <code><a class="el" href="enumcom_1_1amazon_1_1aace_1_1audio_1_1_audio_output_1_1_media_state.html#a2a7414158c5e062e01441d5d9dbadeb3">MediaState.PLAYING</a></code>.</p>
<dl class="section note"><dt>Note</dt><dd>The <code><a class="el" href="classcom_1_1amazon_1_1aace_1_1audio_1_1_audio_output.html">AudioOutput</a></code> platform implementation should be able to support the audio formats recommended by AVS for a familiar Alexa experience: <a href="https://developer.amazon.com/docs/alexa-voice-service/recommended-media-support.html">https://developer.amazon.com/docs/alexa-voice-service/recommended-media-support.html</a> </dd></dl>
</div><h2 class="groupheader">Member Function Documentation</h2>
<a id="aff7e7f7323143c4843d48a0650ce91b4"></a>
<h2 class="memtitle"><span class="permalink"><a href="#aff7e7f7323143c4843d48a0650ce91b4">&#9670;&nbsp;</a></span>prepare() <span class="overload">[1/2]</span></h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">boolean com.amazon.aace.audio.AudioOutput.prepare </td>
          <td>(</td>
          <td class="paramtype">AudioStream&#160;</td>
          <td class="paramname"><em>stream</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">boolean&#160;</td>
          <td class="paramname"><em>repeating</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Notifies the platform implementation to prepare for playback of an audio stream source. Audio data will be available to stream from the Engine via <code>read()</code>. After returning <code>true</code>, the Engine will call <code><a class="el" href="classcom_1_1amazon_1_1aace_1_1audio_1_1_audio_output.html#ab832b921a38be3faa8729a6a7f45b033">play()</a></code> to initiate audio playback.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">stream</td><td>The audio stream to prepare </td></tr>
    <tr><td class="paramname">repeating</td><td><code>true</code> if the audio should repeat</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd><code>true</code> if the platform implementation successfully handled the call, else <code>false</code> </dd></dl>

</div>
</div>
<a id="ae3726cd2b38409262fadedc25a9a68e7"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ae3726cd2b38409262fadedc25a9a68e7">&#9670;&nbsp;</a></span>prepare() <span class="overload">[2/2]</span></h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">boolean com.amazon.aace.audio.AudioOutput.prepare </td>
          <td>(</td>
          <td class="paramtype">String&#160;</td>
          <td class="paramname"><em>url</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">boolean&#160;</td>
          <td class="paramname"><em>repeating</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Notifies the platform implementation to prepare for playback of a URL audio source. After returning <code>true</code>, the Engine will call <code><a class="el" href="classcom_1_1amazon_1_1aace_1_1audio_1_1_audio_output.html#ab832b921a38be3faa8729a6a7f45b033">play()</a></code> to initiate audio playback.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">url</td><td>The URL audio source to prepare </td></tr>
    <tr><td class="paramname">repeating</td><td><code>true</code> if the audio should repeat</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd><code>true</code> if the platform implementation successfully handled the call, else <code>false</code> </dd></dl>

</div>
</div>
<a id="ab832b921a38be3faa8729a6a7f45b033"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ab832b921a38be3faa8729a6a7f45b033">&#9670;&nbsp;</a></span>play()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">boolean com.amazon.aace.audio.AudioOutput.play </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Notifies the platform implementation to start playback of the current audio source. After returning <code>true</code>, the platform implementation must call <code><a class="el" href="classcom_1_1amazon_1_1aace_1_1audio_1_1_audio_output.html#a9e50601e05eb9d32e1f56d75e7849fc3">mediaStateChanged()</a></code> with <code><a class="el" href="enumcom_1_1amazon_1_1aace_1_1audio_1_1_audio_output_1_1_media_state.html#a2a7414158c5e062e01441d5d9dbadeb3">MediaState.PLAYING</a></code> when the media player begins playing the audio or <code><a class="el" href="classcom_1_1amazon_1_1aace_1_1audio_1_1_audio_output.html#affc23414f8a4c0dc7aa518e398123d3c">mediaError()</a></code> if an error occurs.</p>
<dl class="section return"><dt>Returns</dt><dd><code>true</code> if the platform implementation successfully handled the call, else <code>false</code> </dd></dl>

</div>
</div>
<a id="a93328cd0e726f19b596a18343418082c"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a93328cd0e726f19b596a18343418082c">&#9670;&nbsp;</a></span>stop()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">boolean com.amazon.aace.audio.AudioOutput.stop </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Notifies the platform implementation to stop playback of the current audio source. After returning <code>true</code>, the platform implementation must call <code><a class="el" href="classcom_1_1amazon_1_1aace_1_1audio_1_1_audio_output.html#a9e50601e05eb9d32e1f56d75e7849fc3">mediaStateChanged()</a></code> with <code><a class="el" href="enumcom_1_1amazon_1_1aace_1_1audio_1_1_audio_output_1_1_media_state.html#a798d30c76cd7f4d9af4e9bd4ca43a16d">MediaState.STOPPED</a></code> when the media player stops playing the audio or <code><a class="el" href="classcom_1_1amazon_1_1aace_1_1audio_1_1_audio_output.html#affc23414f8a4c0dc7aa518e398123d3c">mediaError()</a></code> if an error occurs.</p>
<p>A subsequent call to <code><a class="el" href="classcom_1_1amazon_1_1aace_1_1audio_1_1_audio_output.html#ab832b921a38be3faa8729a6a7f45b033">play()</a></code> will be preceded by calls to <code><a class="el" href="classcom_1_1amazon_1_1aace_1_1audio_1_1_audio_output.html#aff7e7f7323143c4843d48a0650ce91b4">prepare()</a></code> and <code><a class="el" href="classcom_1_1amazon_1_1aace_1_1audio_1_1_audio_output.html#a228c6e8079d5782e1e7d9b21a925638d">setPosition()</a></code>.</p>
<dl class="section return"><dt>Returns</dt><dd><code>true</code> if the platform implementation successfully handled the call, else <code>false</code> </dd></dl>

</div>
</div>
<a id="a1dfc109dfffdb40f04cdb40cb959772e"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a1dfc109dfffdb40f04cdb40cb959772e">&#9670;&nbsp;</a></span>pause()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">boolean com.amazon.aace.audio.AudioOutput.pause </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Notifies the platform implementation to pause playback of the current audio source. After returning <code>true</code>, the platform implementation must call <code><a class="el" href="classcom_1_1amazon_1_1aace_1_1audio_1_1_audio_output.html#a9e50601e05eb9d32e1f56d75e7849fc3">mediaStateChanged()</a></code> with <code><a class="el" href="enumcom_1_1amazon_1_1aace_1_1audio_1_1_audio_output_1_1_media_state.html#a798d30c76cd7f4d9af4e9bd4ca43a16d">MediaState.STOPPED</a></code> when the media player pauses the audio or <code><a class="el" href="classcom_1_1amazon_1_1aace_1_1audio_1_1_audio_output.html#affc23414f8a4c0dc7aa518e398123d3c">mediaError()</a></code> if an error occurs. A subsequent call to <code><a class="el" href="classcom_1_1amazon_1_1aace_1_1audio_1_1_audio_output.html#a860c1575b54e245352fa2c8d05baf1e9">resume()</a></code> will not be preceded by calls to <code><a class="el" href="classcom_1_1amazon_1_1aace_1_1audio_1_1_audio_output.html#aff7e7f7323143c4843d48a0650ce91b4">prepare()</a></code> and <code><a class="el" href="classcom_1_1amazon_1_1aace_1_1audio_1_1_audio_output.html#a228c6e8079d5782e1e7d9b21a925638d">setPosition()</a></code>.</p>
<dl class="section return"><dt>Returns</dt><dd><code>true</code> if the platform implementation successfully handled the call, else <code>false</code> </dd></dl>

</div>
</div>
<a id="a860c1575b54e245352fa2c8d05baf1e9"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a860c1575b54e245352fa2c8d05baf1e9">&#9670;&nbsp;</a></span>resume()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">boolean com.amazon.aace.audio.AudioOutput.resume </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Notifies the platform implementation to resume playback of the current audio source. After returning <code>true</code>, the platform implementation must call <code><a class="el" href="classcom_1_1amazon_1_1aace_1_1audio_1_1_audio_output.html#a9e50601e05eb9d32e1f56d75e7849fc3">mediaStateChanged()</a></code> with <code><a class="el" href="enumcom_1_1amazon_1_1aace_1_1audio_1_1_audio_output_1_1_media_state.html#a2a7414158c5e062e01441d5d9dbadeb3">MediaState.PLAYING</a></code> when the media player resumes the audio or <code><a class="el" href="classcom_1_1amazon_1_1aace_1_1audio_1_1_audio_output.html#affc23414f8a4c0dc7aa518e398123d3c">mediaError()</a></code> if an error occurs.</p>
<dl class="section return"><dt>Returns</dt><dd><code>true</code> if the platform implementation successfully handled the call, else <code>false</code> </dd></dl>

</div>
</div>
<a id="affc2aadf7fe81a6a9463152ae51420f8"></a>
<h2 class="memtitle"><span class="permalink"><a href="#affc2aadf7fe81a6a9463152ae51420f8">&#9670;&nbsp;</a></span>getPosition()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">long com.amazon.aace.audio.AudioOutput.getPosition </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Returns the current playback position of the platform media player. If the audio source is not playing, the most recent position played should be returned.</p>
<dl class="section return"><dt>Returns</dt><dd>The platform media player's playback position in milliseconds, or <code>TIME_UNKNOWN</code> if the current media position is unknown or invalid. </dd></dl>

</div>
</div>
<a id="a228c6e8079d5782e1e7d9b21a925638d"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a228c6e8079d5782e1e7d9b21a925638d">&#9670;&nbsp;</a></span>setPosition()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">boolean com.amazon.aace.audio.AudioOutput.setPosition </td>
          <td>(</td>
          <td class="paramtype">long&#160;</td>
          <td class="paramname"><em>position</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Notifies the platform implementation to set the playback position of the current audio source in the platform media player</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">position</td><td>The playback position in milliseconds to set in the platform media player</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd><code>true</code> if the platform implementation successfully handled the call, else <code>false</code> </dd></dl>

</div>
</div>
<a id="a1d9d3fc28f5922dd608e5f4a1f774c4b"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a1d9d3fc28f5922dd608e5f4a1f774c4b">&#9670;&nbsp;</a></span>getDuration()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">long com.amazon.aace.audio.AudioOutput.getDuration </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Returns the duration of the current audio source. If the duration is unknown, then <code>TIME_UNKNOWN</code> should be returned.</p>
<dl class="section return"><dt>Returns</dt><dd>The duration of the current audio source in milliseconds, or <code>TIME_UNKNOWN</code>. </dd></dl>

</div>
</div>
<a id="a2c5ab7cf1d8a4183a7b58716dccf916b"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a2c5ab7cf1d8a4183a7b58716dccf916b">&#9670;&nbsp;</a></span>getNumBytesBuffered()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">long com.amazon.aace.audio.AudioOutput.getNumBytesBuffered </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Returns the amount of audio data buffered.</p>
<dl class="section return"><dt>Returns</dt><dd>the number of bytes of the audio data buffered, or 0 if it's unknown. </dd></dl>

</div>
</div>
<a id="a95ca357a61bcf56227684c0a354e44f6"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a95ca357a61bcf56227684c0a354e44f6">&#9670;&nbsp;</a></span>volumeChanged()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">boolean com.amazon.aace.audio.AudioOutput.volumeChanged </td>
          <td>(</td>
          <td class="paramtype">float&#160;</td>
          <td class="paramname"><em>volume</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Notifies the platform implementation to set the volume of the output channel. The <code>volume</code> value should be scaled to fit the needs of the platform.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">volume</td><td>The volume to set on the output channel. <code>volume</code> is in the range [0,1]. </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd><code>true</code> if the platform implementation successfully handled the call, else <code>false</code> </dd></dl>

</div>
</div>
<a id="af9dbd926cff6739c7e9f26029f5f7a29"></a>
<h2 class="memtitle"><span class="permalink"><a href="#af9dbd926cff6739c7e9f26029f5f7a29">&#9670;&nbsp;</a></span>mutedStateChanged()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">boolean com.amazon.aace.audio.AudioOutput.mutedStateChanged </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="enumcom_1_1amazon_1_1aace_1_1audio_1_1_audio_output_1_1_muted_state.html">MutedState</a>&#160;</td>
          <td class="paramname"><em>state</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Notifies the platform implementation to apply a muted state has changed for the output channel</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">state</td><td>The muted state to apply to the output channel. <code>MutedState::MUTED</code> when the output channel be muted, <code>MutedState::UNMUTED</code> when unmuted </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd><code>true</code> if the platform implementation successfully handled the call, else <code>false</code> </dd></dl>

</div>
</div>
<a id="affc23414f8a4c0dc7aa518e398123d3c"></a>
<h2 class="memtitle"><span class="permalink"><a href="#affc23414f8a4c0dc7aa518e398123d3c">&#9670;&nbsp;</a></span>mediaError()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">void com.amazon.aace.audio.AudioOutput.mediaError </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="enumcom_1_1amazon_1_1aace_1_1audio_1_1_audio_output_1_1_media_error.html">MediaError</a>&#160;</td>
          <td class="paramname"><em>type</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">String&#160;</td>
          <td class="paramname"><em>error</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">protected</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<p>Notifies the Engine of an error during audio playback</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">error</td><td>The error encountered by the platform media player during playback</td></tr>
    <tr><td class="paramname">description</td><td>A description of the error</td></tr>
  </table>
  </dd>
</dl>
<dl class="section see"><dt>See also</dt><dd><a class="el" href="enumcom_1_1amazon_1_1aace_1_1audio_1_1_audio_output_1_1_media_error.html">MediaError</a> </dd></dl>

</div>
</div>
<a id="a9e50601e05eb9d32e1f56d75e7849fc3"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a9e50601e05eb9d32e1f56d75e7849fc3">&#9670;&nbsp;</a></span>mediaStateChanged()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">void com.amazon.aace.audio.AudioOutput.mediaStateChanged </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="enumcom_1_1amazon_1_1aace_1_1audio_1_1_audio_output_1_1_media_state.html">MediaState</a>&#160;</td>
          <td class="paramname"><em>state</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">protected</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<p>Notifies the Engine of an audio playback state change in the platform implementation. Must be called when the platform media player transitions between stopped and playing states.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">state</td><td>The new playback state of the platform media player</td></tr>
  </table>
  </dd>
</dl>
<dl class="section see"><dt>See also</dt><dd><a class="el" href="enumcom_1_1amazon_1_1aace_1_1audio_1_1_audio_output_1_1_media_state.html">MediaState</a> </dd></dl>

</div>
</div>
<h2 class="groupheader">Member Data Documentation</h2>
<a id="a60658d83dc03b3999057ace2b2cabefd"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a60658d83dc03b3999057ace2b2cabefd">&#9670;&nbsp;</a></span>TIME_UNKNOWN</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">final long com.amazon.aace.audio.AudioOutput.TIME_UNKNOWN = -1</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<p>Used when audio time is unknown or indeterminate. </p>

</div>
</div>
</div><!-- contents -->
<html>
  <body>
    <hr style="height:1px;border-width:0;color:gray;background-color:gray">
    <p style="text-align:left;">
      Alexa Auto SDK 2.2.0 - Copyright 2017-2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.
      <span style="float:right;">
        Licensed under the <a HREF=http://aws.amazon.com/apache2.0/>Apache License, Version 2.0</a>
      </span>
    </p>
  </body>
</html>
